<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>添加印章</title>
    <link rel="stylesheet" href="/asset/layui/css/layui.css">
    <link rel="Shortcut Icon" href="cachet.ico">
    <script type="text/javascript" src="/asset/js/jquery-3.3.1.min.js"></script>
	<script src="/asset/layui/layui.js"></script>
    <script src="/asset/js/common.js"></script>
    	<link rel="stylesheet" href="/asset/zTree/css/zTreeStyle/zTreeStyle.css" type="text/css">

</head>
<body >
<div>



 <style type="text/css">
.filetree *{white-space:nowrap;}
.filetree span.folder, .filetree span.file{display:auto;padding:1px 0 1px 16px;}
 </style>

<ul id="initTree" class="ztree"></ul>

<script type="text/javascript" src="/asset/zTree/js/jquery.ztree.core.js"></script>

	<SCRIPT type="text/javascript">
		<!--
		
		function showIconForTree(treeId, treeNode) {
			return !treeNode.isParent;
		};
		
		function expandNode(e) {
			var zTree = $.fn.zTree.getZTreeObj("initTree"),
			type = e.data.type;
			if (type == "expandAll") {
				zTree.expandAll(true);
			} else if (type == "collapseAll") {
				zTree.expandAll(false);
			} 
		}
		
		function zTreeOnClick(event, treeId, treeNode) {
			var id = treeNode.id;
			//if(id !=0){
			//	if(treeNode.isParent){
			//		return false;
			//	}
			//}
			if(id == 0){
				parent.right.window.location.href = '/staff/selected/staffs.htm'; 
			}else{
				parent.right.window.location.href = '/staff/selected/staffs.htm?organizationId='+id; 
			}
		};		
		
		var setting = {
			view: {
				showIcon: showIconForTree
			},
			data: {
				simpleData: {
					enable: true
				}
			},
			callback: {
				onClick: zTreeOnClick
			}
		};

		var zNodes =[
			{id:0, pId:-1, name:"全部部门", open:true,icon:"/asset/zTree/css/zTreeStyle/img/diy/1_open.png"}
			<#list orgs as item>
				,{ id:${item.organizationId}, pId:${item.parentId}, name:"${item.name}", open:true}
			</#list>
			
		];

		$(document).ready(function(){
			$.fn.zTree.init($("#initTree"), setting, zNodes);
			$("#expandAllBtn").bind("click", {type:"expandAll"}, expandNode);
			$("#collapseAllBtn").bind("click", {type:"collapseAll"}, expandNode);
		});
		//-->
	</SCRIPT>


</body>
</html>